/* ==========================================
   全局弹框样式
   包含操作类和查看类弹框的统一样式
   ========================================== */

/* ========== 通用对话框基础样式 ========== */
.common-dialog {
  .el-dialog__header {
    padding: 20px 24px;
    border-radius: 8px 8px 0 0;
  }

  .el-dialog__title {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
  }

  .el-dialog__body {
    padding: 24px;
  }

  .el-dialog__footer {
    padding: 16px 24px;
  }

  .dialog-footer {
    text-align: right;
    padding: 16px 0 0;
    border-top: 1px solid #e8eaed;
  }

  .dialog-footer .el-button {
    padding: 10px 24px;
    font-size: 14px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
  }

  .dialog-footer .el-button i {
    margin-right: 4px;
  }
}

/* ========== 操作类弹框样式 ========== */
/* 用于编辑、新增、配置等需要用户输入的弹框 */
/* 简约配色 - 与查看类弹框风格一致 */
.action-dialog {
  .el-dialog__header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px 24px;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid #dee2e6;
  }

  .el-dialog__title {
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;

    i {
      margin-right: 8px;
      color: #409eff;
    }
  }

  .el-dialog__headerbtn .el-dialog__close {
    color: #909399;
    font-size: 20px;
  }

  .el-dialog__headerbtn .el-dialog__close:hover {
    color: #606266;
  }

  .el-dialog__body {
    padding: 24px;
    background: #ffffff;
  }

  /* 用户信息卡片 */
  .user-info-card,
  .info-card {
    background: #f7f8fa;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;

    .info-header,
    .card-header {
      display: flex;
      align-items: center;
      font-size: 16px;
      font-weight: 600;
      color: #2c3e50;
      margin-bottom: 16px;
      padding-bottom: 12px;
      border-bottom: 2px solid #e9ecef;

      i {
        margin-right: 8px;
        color: #409EFF;
        font-size: 18px;
      }
    }

    .info-content {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .info-item {
      display: flex;
      align-items: center;
      font-size: 14px;

      .info-label {
        color: #6c757d;
        font-weight: 500;
        min-width: 80px;
      }

      .info-value {
        color: #2c3e50;
        font-weight: 600;
      }
    }
  }

  /* 配置区域 */
  .config-section,
  .form-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    margin-bottom: 24px;

    &:last-child {
      margin-bottom: 0;
    }

    .section-header,
    .section-title {
      display: flex;
      align-items: center;
      font-size: 16px;
      font-weight: 600;
      color: #2c3e50;
      margin-bottom: 20px;
      padding-bottom: 12px;
      border-bottom: 2px solid #e9ecef;

      i {
        margin-right: 8px;
        color: #409EFF;
        font-size: 18px;
      }
    }
  }

  /* 表单样式 */
  .edit-form,
  .action-form {
    margin-top: 0;

    .el-form-item {
      margin-bottom: 24px;
    }

    .el-form-item__label {
      font-weight: 600;
      color: #495057;
    }

    .el-input__inner:focus,
    .el-input-number.is-controls-right .el-input__inner:focus {
      border-color: #409eff;
    }
  }

  /* 输入框包装器 */
  .input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;

    .el-input-number {
      flex: 1;
    }
  }

  /* 百分比徽章 */
  .percentage-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;

    i {
      font-size: 14px;
    }

    &.primary-badge,
    &.alliance-badge {
      background: #ecf5ff;
      color: #409eff;
      border: 1px solid #b3d8ff;

      i {
        color: #409eff;
      }
    }

    &.success-badge,
    &.ad-badge {
      background: #f0f9ff;
      color: #67c23a;
      border: 1px solid #c2e7b0;

      i {
        color: #67c23a;
      }
    }

    &.warning-badge {
      background: #fdf6ec;
      color: #e6a23c;
      border: 1px solid #f5dab1;

      i {
        color: #e6a23c;
      }
    }
  }

  /* 表单提示 */
  .form-tip {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #909399;
    margin-top: 8px;
    padding: 6px 10px;
    background: #f5f7fa;
    border-radius: 4px;

    i {
      color: #909399;
      font-size: 13px;
    }
  }

  /* 对话框按钮样式 */
  .dialog-footer {
    border-top: 1px solid #e8eaed;
    padding-top: 16px;

    .el-button {
      padding: 9px 20px;
      border-radius: 4px;
      font-size: 14px;

      i {
        margin-right: 4px;
      }
    }

    .el-button--default {
      color: #606266;
      border-color: #dcdfe6;
      background: #ffffff;

      &:hover {
        color: #409eff;
        border-color: #c6e2ff;
        background: #ecf5ff;
      }
    }

    .el-button--primary {
      background: #409eff;
      border-color: #409eff;

      &:hover {
        background: #66b1ff;
        border-color: #66b1ff;
      }

      &:active {
        background: #3a8ee6;
        border-color: #3a8ee6;
      }
    }
  }
}

/* ========== 查看类弹框样式 ========== */
/* 用于详情展示、数据查看等只读类弹框 */
.view-dialog {
  .el-dialog__header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    padding: 20px 24px;
    border-radius: 8px 8px 0 0;
  }

  .el-dialog__title {
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
  }

  .el-dialog__body {
    padding: 24px;
    background: #ffffff;
  }

  /* 详情内容区域 */
  .detail-content {
    padding: 0;
  }

  /* 状态横幅 */
  .status-banner {
    display: flex;
    align-items: center;
    padding: 20px 24px;
    margin-bottom: 24px;
    border-radius: 12px;
    border-left: 4px solid;
    transition: all 0.3s ease;

    &.status-1,
    &.status-pending {
      background: linear-gradient(135deg, #fff9e6 0%, #fff3cc 100%);
      border-left-color: #e6a23c;

      .status-icon {
        background: #fdf6ec;
        color: #e6a23c;
      }

      .status-value {
        color: #e6a23c;
      }
    }

    &.status-2,
    &.status-success {
      background: linear-gradient(135deg, #f0f9ff 0%, #e1f5f0 100%);
      border-left-color: #67c23a;

      .status-icon {
        background: #f0f9ff;
        color: #67c23a;
      }

      .status-value {
        color: #67c23a;
      }
    }

    &.status-3,
    &.status-rejected {
      background: linear-gradient(135deg, #fff1f0 0%, #ffe8e6 100%);
      border-left-color: #f56c6c;

      .status-icon {
        background: #fef0f0;
        color: #f56c6c;
      }

      .status-value {
        color: #f56c6c;
      }
    }

    .status-icon {
      width: 48px;
      height: 48px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-right: 16px;
      font-size: 24px;
    }

    .status-info {
      flex: 1;

      .status-label {
        font-size: 13px;
        color: #909399;
        margin-bottom: 4px;
      }

      .status-value {
        font-size: 20px;
        font-weight: 600;
      }
    }
  }

  /* 信息分组 */
  .info-section {
    margin-bottom: 24px;
    background: #fafbfc;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e8eaed;

    &:last-child {
      margin-bottom: 0;
    }

    .section-title {
      display: flex;
      align-items: center;
      font-size: 16px;
      font-weight: 600;
      color: #303133;
      margin-bottom: 20px;
      padding-bottom: 12px;
      border-bottom: 2px solid #e4e7ed;

      i {
        margin-right: 8px;
        font-size: 18px;
        color: #409eff;
      }
    }

    .info-row {
      margin-bottom: 16px;

      &:last-child {
        margin-bottom: 0;
      }
    }

    .info-item {
      background: white;
      border-radius: 8px;
      padding: 14px 16px;
      border: 1px solid #e8eaed;
      transition: all 0.3s ease;

      &:hover {
        border-color: #409eff;
        box-shadow: 0 2px 8px rgba(64, 158, 255, 0.1);
        transform: translateY(-1px);
      }

      .info-label {
        display: flex;
        align-items: center;
        font-size: 13px;
        color: #909399;
        margin-bottom: 8px;
        font-weight: 500;

        i {
          margin-right: 6px;
          font-size: 14px;
          color: #606266;
        }
      }

      .info-value {
        font-size: 15px;
        color: #303133;
        font-weight: 500;
        word-break: break-all;
      }
    }

    /* 高亮数字 */
    .highlight-number {
      font-size: 24px;
      font-weight: 700;
      color: #409eff;
      margin-right: 4px;
    }
  }

  .highlight-section {
    margin-bottom: 24px;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    /* 高亮项 */
    .highlight-item {
      background: linear-gradient(135deg, #fff9e6 0%, #fffbf0 100%);
      border: 1px solid #ffd666;
    }

    .highlight-item:hover {
      background: linear-gradient(135deg, #fff7d6 0%, #fff9e0 100%);
      border-color: #ffc53d;
    }
  }

  .highlight-section:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
  }

  .highlight-section:last-child {
    margin-bottom: 0;
  }

  /* 特殊区域样式 */
  .reason-section,
  .warning-section {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe8e6 100%);
    border-color: #f56c6c;

    .reason-content,
    .warning-content {
      background: white;
      padding: 16px;
      border-radius: 8px;
      color: #f56c6c;
      font-size: 14px;
      line-height: 1.6;
      border-left: 3px solid #f56c6c;
    }
  }

  /* 证件图片网格 */
  .certificate-grid,
  .image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;

    .certificate-card,
    .image-card {
      background: white;
      border-radius: 12px;
      overflow: hidden;
      border: 2px solid #e8eaed;
      transition: all 0.3s ease;
      cursor: pointer;

      &:hover {
        border-color: #409eff;
        box-shadow: 0 4px 16px rgba(64, 158, 255, 0.15);
        transform: translateY(-4px);

        .certificate-image img,
        .image-wrapper img {
          transform: scale(1.1);
        }

        .image-overlay {
          opacity: 1;
        }
      }

      .certificate-label,
      .image-label {
        display: flex;
        align-items: center;
        padding: 12px 16px;
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
        font-size: 14px;
        font-weight: 600;
        color: #303133;
        border-bottom: 1px solid #e8eaed;

        i {
          margin-right: 8px;
          font-size: 16px;
          color: #409eff;
        }
      }

      .certificate-image,
      .image-wrapper {
        position: relative;
        width: 100%;
        padding-top: 60%; /* 16:10 比例 */
        overflow: hidden;

        img {
          position: absolute;
          top: 0;
          left: 0;
          width: 100%;
          height: 100%;
          object-fit: cover;
          transition: transform 0.3s ease;
        }

        .image-overlay {
          position: absolute;
          top: 0;
          left: 0;
          right: 0;
          bottom: 0;
          background: rgba(0, 0, 0, 0.6);
          display: flex;
          flex-direction: column;
          align-items: center;
          justify-content: center;
          opacity: 0;
          transition: opacity 0.3s ease;
          color: white;

          i {
            font-size: 32px;
            margin-bottom: 8px;
          }

          span {
            font-size: 14px;
            font-weight: 500;
          }
        }
      }
    }
  }

  /* 对话框底部按钮 */
  .dialog-footer .el-button {
    &:hover {
      background-color: #f5f7fa;
      color: #409EFF;
      border-color: #409EFF;
    }
  }
}

/* ========== 图片预览对话框 ========== */
.image-preview-dialog {
  .el-dialog__body {
    padding: 0;
    background: #000;
    text-align: center;

    img {
      max-width: 100%;
      max-height: 80vh;
      display: inline-block;
      vertical-align: middle;
    }
  }

  .el-dialog__header {
    display: none;
  }

  .el-dialog__headerbtn {
    top: 10px;
    right: 10px;
    z-index: 10;

    .el-dialog__close {
      color: #fff;
      font-size: 24px;
      font-weight: bold;

      &:hover {
        color: #409eff;
      }
    }
  }
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
  .action-dialog,
  .view-dialog {
    .info-section .info-item {
      padding: 12px;
    }

    .certificate-grid,
    .image-grid {
      grid-template-columns: 1fr;
      gap: 15px;
    }

    .status-banner {
      padding: 16px;

      .status-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
        margin-right: 12px;
      }

      .status-value {
        font-size: 18px;
      }
    }
  }
}

@media (max-width: 480px) {
  .action-dialog,
  .view-dialog {
    .el-dialog__body {
      padding: 16px;
    }

    .user-info-card,
    .info-card,
    .config-section,
    .form-section,
    .info-section {
      padding: 16px;
    }

    .status-banner {
      flex-direction: column;
      text-align: center;

      .status-icon {
        margin-right: 0;
        margin-bottom: 12px;
      }
    }
  }
}

/* ========== 详情卡片样式（可用于 view-dialog） ========== */
.view-dialog {
  .detail-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    animation: slideInUp 0.4s ease-out;

    &:hover {
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
      transform: translateY(-2px);
    }

    .card-header {
      padding: 16px 20px;
      background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
      border-bottom: 2px solid #dee2e6;
      display: flex;
      align-items: center;
      gap: 10px;
      font-size: 16px;
      font-weight: 600;
      color: #2c3e50;

      i {
        font-size: 18px;
        color: #409EFF;
      }
    }

    .card-body {
      padding: 20px;
    }

    /* 卡片颜色变体 */
    &.basic-info-card .card-header {
      border-left: 4px solid #409eff;
    }

    &.status-info-card .card-header {
      border-left: 4px solid #409eff;
      i {
        color: #409eff;
      }
    }

    &.time-info-card .card-header {
      border-left: 4px solid #67c23a;
      i {
        color: #67c23a;
      }
    }
  }

  /* 详情项样式 */
  .detail-item {
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    &:last-child {
      margin-bottom: 0;
      padding-bottom: 0;
      border-bottom: none;
    }

    .detail-label {
      display: flex;
      align-items: center;
      gap: 8px;
      min-width: 100px;
      font-weight: 500;
      color: #606266;
      font-size: 14px;

      i {
        font-size: 16px;
        color: #909399;
      }
    }

    .detail-value {
      flex: 1;
      color: #303133;
      font-size: 14px;
      text-align: right;
      word-break: break-word;

      &.title-value {
        font-weight: 600;
        font-size: 15px;
        color: #2c3e50;
        text-align: left;
      }

      &.description-value {
        text-align: left;
        line-height: 1.6;
        color: #606266;
        padding: 12px;
        background: #f8f9fa;
        border-radius: 6px;
        border-left: 3px solid #409eff;
      }

      &.time-value {
        font-family: 'Courier New', monospace;
        font-size: 13px;
        color: #606266;
      }

      &.deadline-value.urgent {
        color: #f56c6c;
        font-weight: 600;
        animation: pulse 2s infinite;
      }
    }
  }
}

/* ========== 动画效果 ========== */
@keyframes dialog-fade-in {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.action-dialog,
.view-dialog {
  .el-dialog {
    animation: dialog-fade-in 0.3s ease;
  }

  /* 滚动条美化 */
  .el-dialog__body::-webkit-scrollbar {
    width: 6px;
  }

  .el-dialog__body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
  }

  .el-dialog__body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
  }

  .el-dialog__body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
  }
}

